package edu.sctu.practice.class02.xuqianlan.assign.assign02;

import java.lang.*;
import java.util.Objects;

/**
 * Created by lenovo on 2015/10/29.
 */
public class ComparableCylinder extends Cylinder implements Comparable {
    public int area;

    public ComparableCylinder(int r,int h){
        super(r,h);
    }

    @Override
    public int compareTo(Objects o) {
        area =(int)(2*Math.PI*r*r+h*(2*Math.PI*r));
        System.out.println("圆柱面积："+area);
        return area;
    }
}
